.com-head {
  $height: 60px; /* 基准高度 */
  $bgColor: #2D2F33; /* 背景颜色 */
  $fontColor: white; /* 文字颜色 */

  background-color: $bgColor;
  padding: 0 30px;
  position: relative;
  z-index: 1000;

  .head {
    width: 100%;
    color: $fontColor;
    display: flex;
    justify-content: space-between;
    align-items: center;
    user-select: none;
    margin: 0 auto;

    .left {
      display: flex;
      align-items: center;

      .logo {
        font-size: 24px;
      }

      .cut-off {
        color: #6C6E71;
        margin: 0 10px;
      }

      .title {
        padding-right: 50px;
      }
    }

    .middle {
      flex: 1;
      display: flex;
      align-items: stretch;

      .link {
        display: flex;
        align-items: center;
        height: $height;
        line-height: 100%;
        color: $fontColor;
        padding: 0 20px;
        cursor: pointer;

        &:hover {
          background-color: #535558;
        }

        &.focus-page {
          background-color: rgba(255, 255, 255, 0.18);
          font-weight: bold;
        }
      }
    }

    .right {
      display: flex;
      align-items: center;

      .search {
        border-radius: $height / 4;
        height: $height / 2;
        line-height: $height / 2;
        background-color: #5B5D60;
        display: flex;
        align-items: center;
        padding: 0 15px;

        .input {
          border: none;
          outline: none;
          width: 60px;

          &:focus {
            width: 120px;
          }

          height: 100%;
          background-color: transparent;
          color: $fontColor;
          padding: 5px 0;
          margin-right: 5px;
          transition: width 0.3s;
        }

        .icon {
          width: 20px;
          height: 100%;
          cursor: pointer;
        }
      }

      .user {
        width: $height;
        height: $height;
        padding: 10px;
        margin-left: 10px;
        cursor: pointer;

        &:hover {
          background-color: #535558;
        }

        position: relative;

        .avatar {
          width: 100%;
          height: 100%;
          border-radius: 50%;
          background-image: url('../../assets/images/avatar.svg');
          background-size: cover;
        }

        .menu {
          width: 160px;
          border-bottom-left-radius: 6px;
          border-bottom-right-radius: 6px;
          background-color: white;
          box-shadow: 0 2px 6px 0 rgba(0, 0, 0, 0.15);
          color: #333;
          padding: 6px 0;
          position: absolute;
          top: 60px;
          right: 0;
          cursor: default;

          .user-btn {
            display: block;
            line-height: 44px;
            font-size: 14px;
            color: #333;
            padding: 0 20px;
            transition: none;

            &:last-child {
              border-top: 1px solid #EBEBEB;
              color: #999;
            }

            cursor: pointer;

            &:hover {
              background-color: #00C3FF;
              color: white;
            }
          }
        }
      }
    }
  }

  .modal-login {
    width: 100vw;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.5);

    .content {
      width: 400px;
      border-radius: 4px;
      background-color: white;
      padding: 0 30px 30px;
      margin: 100px auto 0;
      position: relative;

      .method {
        height: 70px;
        border-bottom: 2px solid rgb(220, 220, 220);
        margin-bottom: 30px;
        user-select: none;

        .inner {
          display: inline-block;
          height: 70px;
          line-height: 70px;
          border-bottom: 4px solid transparent;
          color: #999;

          &:not(:last-child) {
            margin-right: 20px;
          }

          cursor: pointer;

          &.selected {
            border-color: #FFE14C;
            color: #333;
          }
        }
      }

      .form {
        font-size: 14px;

        .default-login {
          .input-unit {
            &:not(:last-child) {
              margin-bottom: 15px;
            }

            &:nth-last-child(3) {
              margin: 20px 0;
            }

            &:nth-last-child(2) {
              height: 1em;
              line-height: 1em;
              color: #999;
              display: flex;
              justify-content: space-between;

              span {
                cursor: pointer;
              }
            }

            &:nth-last-child(1) {
              display: flex;
              align-items: center;

              span {
                display: flex;
                align-items: center;
              }

              .icon-box {
                margin: 0 5px;
                cursor: pointer;

                .icon {
                  width: 25px;
                }
              }
            }

            .input-box {
              height: 40px;

              input {
                width: 100%;
                height: 100%;
                border: 1px solid #EBEBEB;
                border-radius: 4px;

                &:focus {
                  border-color: #00C3FF;
                }

                outline: none;
                padding: 0 20px;

                &[disabled] {
                  cursor: not-allowed;
                }
              }

              button {
                width: 100%;
                height: 100%;
                border: 2px solid #00C3FF;
                border-radius: 4px;
                background-color: #00C3FF;
                color: white;

                &:hover {
                  border-color: #74D9F1;
                }

                cursor: pointer;
                user-select: none;

                &[disabled] {
                  border-color: silver;
                  background-color: silver;
                  cursor: not-allowed;
                }
              }
            }
          }
        }

        .error-text {
          color: #F4606C;
          line-height: 2em;
        }
      }

      .close-btn {
        width: 30px;
        height: 30px;
        border-radius: 10px;
        display: flex;
        justify-content: center;
        align-items: center;
        position: absolute;
        top: 0;
        right: -45px;
        cursor: pointer;
      }
    }
  }
}
